import { defineStore } from "pinia";

export const useOrderStore = defineStore({
  id: "order", // id必填，且需要唯一
  state: () => {
    return {
      store_order_confirm_door: {
        before_work_img: [],
        visit_img: [],
        work_clothes_img: [],
      },
      store_order_confirm_service: {
        after_service_img: [],
        service_img: [],
      },
      meal_data: {},
      serviceDetail: {
        params: {},
        pro_info: {},
      },
      return_visit: {},
    };
  },
  getters: {
    // fullName: (state) => {
    //     return state.name + '丰'
    // }
  },
  actions: {
    updateData(key: string, value: any) {
      this[key] = value;
    },
  },
  persist: {
    enabled: true,
    strategies: [
      {
        storage: localStorage,
      },
    ],
  },
});
